public class MultiplySum {
    public static void main(String[] args) {
        for(int i = 1; i <= 100; i++) {
            if(i == 1 || i == 2)
                System.out.print(i + " ");

           for(int j = 2; j < i; j++) {
                if(i % j == 0)  break;
                if(j == i-1)
                    System.out.print(i + " ");
           }
        }
    }
}
